<!DOCTYPE html>
@args List<Comments> comments,List<Contents> articles,Statistics statistics,List<Logs> logs,Map<String,String> options,String siteUrl
@include(header)

<div class="row">
    <div class="col-sm-12">
        <h4 class="page-title">Tale仪表盘</h4>
    </div>

    <div class="row">
        <div class="col-sm-6 col-lg-3">
            <div class="mini-stat clearfix bx-shadow bg-info">
                <span class="mini-stat-icon"><i class="fa fa-quote-right" aria-hidden="true"></i></span>
                <div class="mini-stat-info text-right">
                    发表了<span class="counter">@statistics.articles@</span>篇文章
                </div>
            </div>
        </div>
        <div class="col-sm-6 col-lg-3">
            <div class="mini-stat clearfix bg-purple bx-shadow">
                <span class="mini-stat-icon"><i class="fa fa-comments-o" aria-hidden="true"></i></span>
                <div class="mini-stat-info text-right">
                    收到了<span class="counter">@statistics.comments@</span>条留言
                </div>
            </div>
        </div>

        <div class="col-sm-6 col-lg-3">
            <div class="mini-stat clearfix bg-success bx-shadow">
                <span class="mini-stat-icon"><i class="fa fa-cloud-upload" aria-hidden="true"></i></span>
                <div class="mini-stat-info text-right">
                    上传了<span class="counter">@statistics.attachs@</span>个附件
                </div>
            </div>
        </div>

        <div class="col-sm-6 col-lg-3">
            <div class="mini-stat clearfix bg-primary bx-shadow">
                <span class="mini-stat-icon"><i class="fa fa-link" aria-hidden="true"></i></span>
                <div class="mini-stat-info text-right">
                    友链了<span class="counter">@statistics.links@</span>个好友
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-4">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">最新文章</h4>
                </div>
                <div class="panel-body">
                    <ul class="list-group">
                        @for(article : articles) {
                        <li class="list-group-item">
                            <span class="badge badge-primary"
                                  title="@article.comments_num@条评论">@article.comments_num@</span>
                            <a target="_blank" href="@siteUrl/article/@article.cid@">@article.title@</a>
                        </li>
                        }
                    </ul>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">最新留言</h4>
                </div>
                <div class="panel-body">

                    @if(comments) {
                        @for(comment : comments){
                        <ul class="list-group">

                            <li class="list-group-item">
                                @if(comment.getUrl()){
                                <a href="@comment.url@" target="_blank">@comment.author@</a>
                                }
                                else{
                                @comment.author@
                                }
                                于
                                @timeStampToString(comment.getCreated())：<a href="@siteUrl/article/@comment.cid@ #comments" target="_blank">@comment.content@</a>
                            </li>

                        </ul>
                        }
                    }
                    else {
                    <div class="alert alert-warning">
                        还没有收到留言.
                    </div>
                    }
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">系统日志</h4>
                </div>
                <div class="panel-body">
                    <ul class="list-group">
                        @for(log : logs){
                        <li class="list-group-item">
                            <span>@timeStampToString(log.getCreated()) => @log.action@</span>
                        </li>
                        }
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
@include(footer)
</body>
</html>